(Quick Reference)
p:displayMessage
Purpose
This tag renders a message for the user which has been set using the
displayMessage or
displayFlashMessage methods in the controller.
It will automatically display the message stored in request or flash scope, or
both if both are set.
The text is rendered using i18n messages and arguments if supplied when the
displayMessage
or
displayFlashMessage
methods were called.
The output is wrapped in a single div, with a class that you supply plus the
message type.
Example
<p:displayMessage class="msg"/>
So for example with the above, if your controller has called:
displayMessage text:'book.save.error', args:[book.title], type:'alert'
This might output:
<div class="msg alert">
Something has gone wrong saving book "The Design of Everyday Things"
</div>
Attributes
Name | Purpose |
---|
class | CSS classes to apply to the div. The value of the message "type" will be appended to the class list |
Any other attributes specified are passed through to g:message to create the text.